import request from '@/config/axios'

// 区域列表 VO
export interface JkAreaVO {
  id: number // id
  name: string // 区域名称
}

// 区域列表 API
export const JkAreaApi = {
  // 查询区域列表分页
  getJkAreaPage: async (params: any) => {
    return await request.get({ url: `/jikong/jk-area/page`, params })
  },

  getJkAreaSimpleList: async (params: any) => {
    return await request.get({ url: `/jikong/jk-area/simple-list`, params })
  },

  // 查询区域列表详情
  getJkArea: async (id: number) => {
    return await request.get({ url: `/jikong/jk-area/get?id=` + id })
  },

  // 新增区域列表
  createJkArea: async (data: JkAreaVO) => {
    return await request.post({ url: `/jikong/jk-area/create`, data })
  },

  // 修改区域列表
  updateJkArea: async (data: JkAreaVO) => {
    return await request.put({ url: `/jikong/jk-area/update`, data })
  },

  // 删除区域列表
  deleteJkArea: async (id: number) => {
    return await request.delete({ url: `/jikong/jk-area/delete?id=` + id })
  },

  // 导出区域列表 Excel
  exportJkArea: async (params) => {
    return await request.download({ url: `/jikong/jk-area/export-excel`, params })
  }
}
